<?php
class frm_mngcertificates{
	private $args;
	function __construct($arg){
		$this->args = $arg;
	}
	function getPublish(){
		if(Session::isLogin()){
			$ptn = readPattern($_SESSION[ "service_dir" ]  .'/pattern/' .'ptn_'. "frm_mngcertificates" .'.php' );
			$ptn->list_certificates = '';
			$ptn_item = readPattern($_SESSION[ "service_dir" ]  .'/pattern/' .'ptn_'. "item_certificate" .'.php' );
			$ptn_item->mac_address = '';
			$ptn_item->infomation = '';
			$str = "";
			$mail_address = FunctionSession::getEmailAddress();
			$cers = FunctionData::readCertificates($mail_address)->getCertificates();
			if(is_array($cers)){
				foreach($cers as $cer){
					$ptn_item->mac_address = $cer->getUniqueID();
					$ptn_item->infomation = $cer->getInfomation();
					$ptn->list_certificates .=  $ptn_item ->publish() ;
				}
			}
			$str .=  $ptn ->publish() ;
			return $str;
		}else{
		}
	}
}
?>